// 原型模式
interface InterfaceRobotFactory {
    name: string;// 名称
    price: number;// 价格
    power: number;// 功率
    color: string;// 颜色
}

// 机器人
class Robot {
    public name: string
    public price: number
    public power: number
    public color: string

    constructor() {
        this.name = 'robot'
        this.price = 100
        this.power = 100
        this.color = 'pink'
    }

    public writeRobotInfo() {
        console.log('robot：', this.name, this.price, this.power, this.color)
    }
}

const robot1 = new Robot()
robot1.writeRobotInfo()

const robot2 = Object.create(robot1)
robot2.name = 'robot2'
robot2.writeRobotInfo()

const robot3 = robot1
robot3.name = 'robot3'
robot3.writeRobotInfo()